<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <srabol@mail.tele.dk>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: LookupIPCountry.php 340 2010-01-30 22:44:10Z steen.rabol@gmail.com $
 *
 */

class LookupIPCountry extends PortalAdminPage
{
	public function onLoad($param)
	{
		parent::onLoad($param);

		$this->setAdminPageTitle('Add page');
	}
	function processMessage($sender, $param)
	{
		if(strlen($this->userinput->Text) > 0)
		{
			include_once(Prado::getPathOfNamespace('Application.Common.3rdParty.shortstat') . '/shortstat.php');
			$ip		= $this->userinput->Text;
			$cntry	= SI_determineCountry($ip);
			$lang	= SI_determineLanguage();
			$this->lblReply->Text = $cntry . ' ' . $lang;
			$this->userinput->Text = '';
		}
		else
		{
			$this->lblReply->Text = Prado::localize('Invalid IP');
		}
	}

}
?>